Sebastian Wick [Mon, 9 Oct 2023 22:13:40 +0000 (00:13 +0200)]
shell-app: Make recent all app windows on the target workspace
meta_window_raise_and_make_recent_on_workspace now works on a target
workspace instead of the active workspace. We call this before another
workspace is made active so the previous behavior made the window the
MRU window on the wrong workspace. If an app got activated and one
window closed, the stacking and focus diverged.
Sebastian Keller [Sun, 22 Oct 2023 23:06:59 +0000 (01:06 +0200)]
calendar: Emit selected-date-changed before rebuilding the calendar
If the cursor was placed on one of the widgets that get removed when
rebuilding the calendar due to a month change, destroying the hovered
widget will trigger a repick. This repick can then trigger an allocation
while not all buttons of the calendar are present.
If the last allocation before selected-date-changed is emitted was from
such an incomplete state, DateMenuButton will still freeze the layout in
this state in its signal handler.
What freezing the layout in DateMenuButton is supposed to do is to
prevent size changes of the menu when changing days, but for this the
layout needs to be frozen before potentially rebuilding calendar. This
change ensures that by emitting the signal earlier.
st/scroll-view: Use clutter_actor_get_effect() to get fade effect
Storing the pointer to the fade effect only works as long as we control
all the code that can modify the effects of an actor, but this is not
the case in the presence of extensions. Apparently some extension
manages to remove the effect, which leads to fade_effect pointing to
some invalid address by the time dispose is called, leading to a crash.
This instead uses clutter_actor_get_effect() to get the effect when it
is needed to avoid crashing in these situations.
overview: Handle unredirection in OverviewShown state machine
Under certain unknown circumstances currently not every
`disable_unredirect_for_display()` gets matched with an
`enable_unredirect_for_display()` when closing the overview.
As we only want to not disable unredirection when hidden and we nowadays
have a state machine that ensures we transition to and from one state to
another only once, handle unredirection en-/disablement as part of the
state transition.
status/system: Use Intl to format battery percentage
The exact way of formatting a percentage value is locale specific:
https://en.wikipedia.org/wiki/Percent_sign#Correct_style.
We account for that by marking the string for translations, but then
get it wrong for the default US locale (go us!).
But given that the javascript engine itself provides us with a way
of formatting a percentage in a locale-specific way, that seems the
better option than putting the burden on our own developers and
translators.
Carlos Garnacho [Fri, 22 Sep 2023 11:21:32 +0000 (13:21 +0200)]
slider: Ignore left/right scroll directions
Both of these ended up with a "undefined" delta, which turned
the final value into 0 no matter the previous state.
While this was already fixed for touchpads in the previous commit
(by not forwarding emulated discrete events), this looks somewhat
out of place even for the mice that have left/right discrete scroll
actions (e.g. tilting the scroll wheel left or right).
Let these unhandled directions have a delta of 0, and focus on
vertical scroll for both smooth and discrete events.
Carlos Garnacho [Fri, 22 Sep 2023 11:16:59 +0000 (13:16 +0200)]
slider: Fix check for emulated scroll events
The name given by g-i is actually FLAG_POINTER_EMULATED, this
made the check slightly ineffective, handling both real and
emulated events in the case of touchpad scrolling.
The pipeline contains a GST plugin that pops up an unclosable
zero-sized window.
Unfortunately we did not manage to come up with a proper fix
in time, so for now explicitly exclude it from app tracking.
This does not address all issues (it still prevents the
window's workspace from getting removed, even when it appears
empty), but at least it avoids the most confusing effect by
preventing the "app" from showing up in dash, alt-tab etc.
extensionSystem: Update immediately after major upgrades
Currently we periodically check for updated extensions, prepare
an update and perform it at the next login.
This is largely due to the fact that once an extension has been
loaded, its code is cached and reloading it would only make it
*appear* as updated, while in reality still running the old code.
Of course this only applies *once* we have loaded extensions.
Before that, it's possible to download and install updates, and
only then initialize extensions with their latest version.
The trade-off is that network requests, data download and extraction may
introduce a significant delay before extensions
are enabled. Most extensions modify the UI one way or another,
so that delay would likely be noticeable by the user.
Assuming that users are usually happy enough with the current
extension version, that trade-off doesn't seem worthwhile.
However there is an exception: After a major version update,
extensions are likely disabled as out-of-date, or at least
more likely to break (when the version check is disabled).
In that case delaying extension initialization to download
and install updates looks like the better trade-off, so do
that.
ibusManager: Add missing environment variables required to launch ibus-daemon
IBus requires XAUTHORITY and XDG_RUNTIME_DIR to be able to spawn its XIM
implementation correctly. Using launch context to get environment can correctly
launch on non-systemd setups.
When commit 4d963c432b introduced the global workspace adjustment,
it mostly copied the adjustment handling from the overview that it
set out to replace.
That includes cancelling ongoing transitions when the number of
workspaces changed. However that missed that transitions don't
happen on the main adjustment, but on the "child" adjustments
returned from `createWorkspacesAdjustment()`.
Address this by tracking all child adjustments, and cancel transitions
there as well when necessary. Use weak refs to not
interfere with garbage collection, in case an extension creates
its own child adjustment.
Carlos Garnacho [Fri, 8 Sep 2023 17:01:29 +0000 (19:01 +0200)]
keyboard: Only reset to the default level on unlocked latched levels
Reportedly, non-alphanumeric key levels were able to stick by
happenstance, and let the user press multiple keys until explicitly
switching to a different mode. Reportedly, this broke, switching to
the default level after the first key press on the additional levels.
Since we have this information in the OSK key models (each level has
a "mode" field to either default/latched/locked), retrieve this
information for them for each level, and only reset to the default
level if on one of those latched levels, and the relevant key was not
locked through long-press.
Carlos Garnacho [Fri, 8 Sep 2023 16:51:34 +0000 (18:51 +0200)]
keyboard: Reset latched levels on string commit on all situations
The _commitAction() paths have early returns, which made resetting the
latched mode inconsistent depending on the paths taken to commit the
string. This made latched modes not return to normal on e.g. Shell
entries.
Make this happen outside the function, and after the only calling
point, so that the level is correctly reset on all situations.
Florian Müllner [Fri, 11 Aug 2023 22:32:35 +0000 (00:32 +0200)]
workspaceThumbnail: Expose maxThumbnailScale as property
Some extensions want to modify the value of the MAX_THUMBNAIL_SCALE
constant. That is no longer possible, as exports are always read-only
from the outside.
Make this possible again by exposing the scale as a property on the
object itself, so extensions can override it.
While extremely rare, flatpak apps are not guaranteed to provide
a .desktop file.
We don't have anything to represent the app in that case, but at
least we shouldn't break when trying to access properties on null,
so filter out these entries.
Lukáš Tyrychtr [Tue, 1 Nov 2022 15:54:54 +0000 (16:54 +0100)]
popupMenu: Allow to use the up and down arrows to wrap around
This aligns the keyboard navigation behavior with similar menus in
other desktop environments and with GTK itself.
It allows the users to move in the menu using already known patterns
and makes the operation quicker in some cases, especially as many
users don't know about the tab and shift+tab behavior.
Florian Müllner [Sun, 20 Aug 2023 19:38:37 +0000 (21:38 +0200)]
panel: Switch workspaces when scrolling over activities
The activities button now shows workspace indicators instead
of a label. Adding the ability to switch workspaces without
entering the overview seems like a logical extension.
Florian Müllner [Thu, 31 Aug 2023 23:40:36 +0000 (01:40 +0200)]
doc: Add looking glass documentation
Looking glass is not just helpful for development, but also when
asking users to provide relevant information.
Having it in-tree makes it easy to reference, and ensures that
the documentation is still in a maintained place when plans to
retire the wiki go head.
The content is based on the [wiki-page] with updated code samples,
small sections on added features, and outdated references removed
(anyone remember project looking glass?).
Florian Müllner [Wed, 30 Aug 2023 21:56:30 +0000 (23:56 +0200)]
status/bluetooth: Only show when rfkill is available
We currently show the bluetooth toggle when Bluetooth can be
toggled via rfkill, or when there is a powered adapter.
While the latter condition is obvious - if there is a working
Bluetooth adapter, then Bluetooth is available - it does impose
a problem: We rely on rfkill for turning Bluetooth off, so if
rfkill is missing, the toggle is stuck.
We could handle that case and power off the adapter ourselves
when necessary, but then the toggle would just disappear when
turned off.
Instead, only show the toggle when rfkill is available, so we
can assume that turning Bluetooth on and off will work.
This is also consistent with Settings, which shows Bluetooth
as unavailable in this case.
Florian Müllner [Wed, 30 Aug 2023 03:44:46 +0000 (05:44 +0200)]
windowMenu: Use NONE ornament by default
We now hide ornaments by default. As some of the items in the
window menu can be checked, that means that they will now shift
horizontally, and no longer align with other menu items when
checked.
That's quite bad, and as the items in question don't form a
distinctive group/section, adding back the spacing only to
those two items would still look fairly awkward.
So revert back to the previous behavior for this particular menu,
and default to the NONE ornament.
Carlos Garnacho [Wed, 30 Aug 2023 08:14:16 +0000 (10:14 +0200)]
st: Drop explicit Clutter grab in StButton
Nowadays, Clutter knows what an implicit grab is, which gives
us already the feel that we are after with buttons (e.g. press
and drag on the button will not enter other actors meanwhile).
ClutterGrab was only added to provide that feel meanwhile, and
it's also slightly more intense (e.g. altering keyboard focus,
or triggering leave events on all parents of the button) which
may trigger side effects.
An example is the IBus candidates popup, where the pagination
buttons may indirectly trigger dismissing of the entire popup
when interacted, by stealing the keyboard focus to the
client/actor doing IM.
Florian Müllner [Tue, 29 Aug 2023 17:09:21 +0000 (19:09 +0200)]
status/network: Don't show OWE networks as secure
The OWE protocol is used by public networks to provide some
form of encryption, but without authentication. That makes
them more secure than unencrypted public networks, but still
significantly less secure than "proper" encryption types like
WPA.
The are not shown as secure by Settings' network panel, so we
shouldn't do so either.
Florian Müllner [Tue, 29 Aug 2023 16:54:01 +0000 (18:54 +0200)]
status/network: Consider active connection for network's active state
We currently show a network as connected when it includes the
device's active access point.
However when connected to an OWE transition network, the public
AP redirects to a hidden AP that we ignore. To handle that case,
also consider a network active when it includes the currently
active connection.